package com.scm.service;

import com.scm.common.core.domain.entity.SysUser;
import com.scm.common.enums.OrderStatus;
import com.scm.dto.resp.order.OrderProductDo;
import com.scm.dto.resp.order.QueryOrderPageResp;
import com.scm.dto.resp.order.ScmOrderLogDO;
import com.scm.persist.model.ScmOrder;
import com.scm.persist.model.ScmOrderLog;
import com.scm.persist.model.ScmOrderOperation;
import com.scm.persist.model.ScmOrderProduct;

import java.util.List;

/**
 * 订单主Service接口
 *
 * @author reptilemanager
 * @date 2024-02-08
 */
public interface IScmOrderService
{
    /**
     * 查询订单主
     *
     * @param id 订单主主键
     * @return 订单主
     */
    public ScmOrder selectScmOrderById(Long id);

    public void syncProudct(Long id);

    /**
     * 查询订单主列表
     *
     * @param scmOrder 订单主
     * @return 订单主集合
     */
    public QueryOrderPageResp selectScmOrderList(ScmOrder scmOrder, Integer start, Integer size ,SysUser sysUser);

    public List<OrderProductDo> selectScmOrderProductList(Long tenantId,Long orderId);

    public List<ScmOrderLogDO> selectScmOrderLogList(Long tenantId, Long orderId);


    /**
     * 新增订单主
     *
     * @param scmOrder 订单主
     * @return 结果
     */
    public long insertScmOrder(ScmOrder scmOrder, SysUser sysUser);

    /**
     * 修改订单主
     *
     * @param scmOrder 订单主
     * @return 结果
     */
    public int updateScmOrder(ScmOrder scmOrder,SysUser sysUser);



    /**
     * 删除订单主信息
     *
     * @param id 订单主主键
     * @return 结果
     */
    public int deleteScmOrderById(Long id);

    public int confirmOrder(Long id, SysUser sysUser);


    public Long saveOrUpdateScmOrder(SysUser sysUser,ScmOrder scmOrder);

    ScmOrderOperation selectByScmOrderId(Long scmOrderId);

    public void updateBaobeiStatus(String omsOrderId);

    public void updateOrderStatus(Long scmOrderId, OrderStatus orderStatus);

    int updateScmOrderOperation(ScmOrderOperation scmOrderOperation);


}
